package com.zeratul.cloud.base;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;

/**
 * 启动类基类
 */
@Slf4j
public class BaseApplication {

    static {
        //关闭nacos默认日志配置，解决和log4j2兼容性问题
        System.setProperty("nacos.logging.default.config.enabled", "false");
    }

    /**
     * 启动方法
     * @param primarySource
     * @param args
     */
    protected static void run(Class<?> primarySource, String... args) {
        try {
            SpringApplication.run(primarySource, args);
        } catch (Throwable e) {
            log.error("启动失败！", e);
        }
    }
}
